package com.example.demo.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.enums.ApiErrorCode;
import com.example.demo.entity.ProjectPermissionEntity;
import com.example.demo.service.ProjectPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @DESCRIPTION:
 * @AUTOOR: Lee
 * @DATE: 2022年09月18日 1:27
 */
@RestController
@RequestMapping("/projectPermission")
public class ProjectPermissionController {

    private final ProjectPermissionService projectPermissionService;


    @Autowired
    public ProjectPermissionController(ProjectPermissionService projectPermissionService) {
        this.projectPermissionService = projectPermissionService;
    }



    @PostMapping("/create")
    public R<ProjectPermissionEntity> createUser(@RequestBody ProjectPermissionEntity projectPermission) {
        ProjectPermissionEntity projectEntity = projectPermissionService.create(projectPermission);
        return R.restResult(projectEntity, ApiErrorCode.SUCCESS.getCode(), "创建权限成功");
    }

}
